package com.mockapi.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 事件触发记录实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("event_trigger")
public class EventTrigger {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 事件ID
     */
    @TableField("event_id")
    private Long eventId;

    /**
     * 触发时间
     */
    @TableField("trigger_time")
    private LocalDateTime triggerTime;

    /**
     * 触发类型(SCHEDULE,MOCK_CALL)
     */
    @TableField("trigger_type")
    private String triggerType;

    /**
     * 触发源
     */
    @TableField("trigger_source")
    private String triggerSource;

    /**
     * 执行状态(PENDING,RUNNING,SUCCESS,FAILED)
     */
    @TableField("execution_status")
    private String executionStatus;

    /**
     * 请求数据(JSON格式)
     */
    @TableField("request_data")
    private String requestData;

    /**
     * 响应数据(JSON格式)
     */
    @TableField("response_data")
    private String responseData;

    /**
     * 错误信息
     */
    @TableField("error_message")
    private String errorMessage;

    /**
     * 执行时间(毫秒)
     */
    @TableField("execution_time_ms")
    private Integer executionTimeMs;

    /**
     * 重试次数
     */
    @TableField("retry_count")
    private Integer retryCount;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
} 